#include <stdio.h>
#include <stdlib.h>

#define COUNT 5
int main(int argc, char *argv[]) {
  /* malloc练习
   */
  double *pScore = (double *)malloc(sizeof(double) * 5);
  if (pScore == NULL) {
    printf("内存分配失败\n");
    return -1;
  }
  for (int i = 0; i < COUNT; i++) {
    printf("请输入第%d个同学的成绩：", i + 1);
    scanf("%lf", pScore + i);
  }
  printf("成绩不合格的同学：\n");
  for (int i = 0; i < COUNT; i++) {
    if (*(pScore + i) < 60.0) {
      printf("%d: %lf\n", i + 1, *(pScore + i));
    }
  }
  free(pScore);
  return EXIT_SUCCESS;
}
